The background description provided herein is for the purpose of generally presenting the context of the disclosure. Work of the presently named inventors, to the extent it is described in this background section, as well as aspects of the description that may not otherwise qualify as prior art at the time of filing, are neither expressly nor impliedly admitted as prior art against the present disclosure.
Referring now to FIG. 1, a functional block diagram of a processor and memory system 10 is shown. A processor 100 executes a program that is stored in memory. For example only, the program may be stored in memory located in an instruction memory 102 (e.g. in nonvolatile memory 104), in the processor 100, and/or in random access memory (RAM) 106. For example only, the program may include instructions for the processor 100 to write or retrieve data from memory blocks 108-1, 108-2, . . . , 108-n, referred to collectively as memory blocks 108.
Memory blocks 108 contain data in the form of a bit array. The bit array is a data structure that stores individual bits. The individual bits may be retrieved by the processor 100. Further, the processor 100 may write data to the memory blocks 108 for later use. When the processor 100 is instructed to write to the memory blocks 108, the data is transmitted to an error correction code module (ECCM) 110.
The ECCM 110 detects and corrects errors in the memory blocks 108. When the ECCM 110 receives data from the processor 100 to write to the memory blocks 108, the ECCM 110 calculates a checksum. The checksum is an arithmetic sum of the bits stored in one of the respective memory blocks 108. For example, the checksum in memory block 108-1 is an arithmetic sum of the bits stored in memory block 108-1.
When the processor 100 is instructed to retrieve data from one of the memory blocks 108, the ECCM 110 retrieves the data from the one of the memory blocks 108 and detects whether an error exists in the data. If an error exists, then the ECCM 110 may correct the error by using the respective checksum. The data is then transmitted to the processor 100. If the error exists and is not correctable, then the ECCM 110 may indicate that an error has occurred.
An external device 112 may communicate with the processor 100. The external device 112 may receive data from or send data to the processor 100.